import { ApiProperty } from "@nestjs/swagger";
import { BaseEntity } from "src/common/entities/entities";
import { Column, Entity, ManyToMany } from "typeorm";
import { MovieEntity } from "../../movies/entities/movie.entity";
@Entity('tags')
export class TagEntity extends BaseEntity {
    /** 名称 */
    @ApiProperty({ example: 'name', description: '名称' })
    @Column({
        type: 'varchar',
        comment: '名称',
        length: 255,
    })
    name: string;

    /** 语言 */
    @ApiProperty({ example: 'lang', description: '语言' })
    @Column({
        type: 'varchar',
        comment: '语言',
        length: 50,
    })
    lang: string;

    @ManyToMany(() => MovieEntity, (movie) => movie.tags)
    movies: MovieEntity[];
}
